<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui" xmlns:f="http://java.sun.com/jsf/core"
                xmlns:constants="http://www.tuanzi.com/constants/tags"
                xmlns:security="http://www.springframework.org/security/tags"
                template="/templates/template.xhtml">
    <ui:define name="title">用户手机号导出</ui:define>
    <ui:define name="content">
        <h:form>
           <p:defaultCommand target="search"/>
            <div class="topbar clearfix"
                 style="background: -webkit-linear-gradient(top,#f6f7f9 0,#ebedf0 100%);">
                <p:toolbar>
                    <f:facet name="right">
                        <p:commandButton id="search" value="查询" icon="fa fa-search"
                        				 actionListener="#{userMobileExportBean.onCheck}"
                                         update="@form"
                                         ajax="false"
                                         rendered="#{userMobileExportBean.isNormal()}"/>

                        <p:commandButton value="重置" icon="fa fa-refresh"
                                         actionListener="#{userMobileExportBean.onReset}"
                                         process="@this"
                                         update="@form"
                                         rendered="#{userMobileExportBean.isNormal()}"/>
						 
                        <p:commandButton value="导出" icon="fa fa-download"  update="@form"
                         				 action="#{userMobileExportBean.exportExcel()}"   
                        				 actionListener="#{userMobileExportBean.onCheck}" 
                        				 rendered="#{userMobileExportBean.isNormal()}"
                        				 ajax="false"/>
                    </f:facet>
                </p:toolbar>
            </div>
            
            <div class="ui-fluid" style="padding-top: 30px;">
                <div class="ui-g">
                    <div class="ui-g-12">
                        <div class="card">
                         <h1>查询条件</h1>
                            <p:panelGrid columns="8" layout="grid"
                                         columnClasses="ui-grid-col-1,ui-grid-col-2"
                                         styleClass="ui-panelgrid-blank"
                                         style="border:0px none; background-color:transparent;">
								
								<p:outputLabel for="startRecTime" value="登记时间"/>
                                <p:calendar id="startRecTime" value="#{userMobileExportBean.$.startRecTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>-
								 <p:calendar id="endRecTime" value="#{userMobileExportBean.$.endRecTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>
                               
                               	<p:outputLabel for="startRegTime" value="注册时间"/>
                                <p:calendar id="startRegTime" value="#{userMobileExportBean.$.startRegTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>-
								 <p:calendar id="endRegTime" value="#{userMobileExportBean.$.endRegTime}"
                                            locale="#{constants:get('LOCALE')}"
                                            timeZone="#{constants:get('TIME_ZONE')}"
                                            pattern="#{constants:get('DATE_FORMAT')}"/>

                                <p:outputLabel for="activityType" value="活动类型"/>
                                <p:selectOneMenu id="activityType" value="#{userMobileExportBean.$.activityType}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItem itemLabel="空" itemValue="-1" />
                                    <f:selectItems
                                            value="#{userMobileExportBean.activityTypes}"
                                            var="type"
                                            itemLabel="#{type.activityTypeName}" itemValue="#{type.activityType}"/>
                                </p:selectOneMenu>

                                <p:outputLabel for="activityId" value="活动标识"/>
                                 <p:inputText id="activityId" value="#{userMobileExportBean.$.activityId}"/>

                                <p:outputLabel for="product" value="产品"/>
                                <p:selectOneMenu id="product" value="#{userMobileExportBean.$.product}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{userMobileExportBean.commProductIds}"
                                            var="product"
                                            itemLabel="#{product.name}" itemValue="#{product.productId}"/>
                                </p:selectOneMenu>

                                <p:outputLabel for="channel" value="渠道"/>
                                <p:selectOneMenu id="channel" value="#{userMobileExportBean.$.channel}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{userMobileExportBean.commProductChannels}"
                                            var="channel"
                                            itemLabel="#{channel.channelName}" itemValue="#{channel.channelCode}"/>
                                </p:selectOneMenu>

                                <p:outputLabel for="platform" value="平台"/>
                                <p:selectOneMenu id="platform" value="#{userMobileExportBean.$.platform}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItem itemLabel="ios" itemValue="0"/>
                                    <f:selectItem itemLabel="android" itemValue="1"/>
                                </p:selectOneMenu>
                                
                                <p:outputLabel for="userType" value="用户类型"/>
                                <p:selectOneMenu id="userType" value="#{userMobileExportBean.$.userType}">
                                    <f:selectItem itemLabel="注册用户" itemValue="0" noSelectionOption="true"/>
                                    <f:selectItem itemLabel="登记未注册用户" itemValue="1"/>
                                </p:selectOneMenu>

								<p:outputLabel for="blacklist" value="用户黑名单状态"/>
                                <p:selectOneMenu id="blacklist" value="#{userMobileExportBean.$.blacklist}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItem itemLabel="无" itemValue="-1"/>
                                    <f:selectItems
                                            value="#{userMobileExportBean.blacklistTypes}"
                                            var="type"
                                            itemLabel="#{type.typeName}" itemValue="#{type.typeCode}"/>
                                </p:selectOneMenu>
							
                                <p:outputLabel for="unionLogin" value="屏蔽联登活动"/>
                                <p:selectOneMenu id="unionLogin" value="#{userMobileExportBean.$.unionLogin}">
                                    <f:selectItem itemLabel="- 请选择 -" itemValue="" noSelectionOption="true"/>
                                    <f:selectItems
                                            value="#{userMobileExportBean.dictionaries[DictionaryCode.UNION_SERIAL]}"
                                            var="union"
                                            itemLabel="#{union.name}" itemValue="#{union.value1}"/>
                                </p:selectOneMenu>


                            </p:panelGrid>
                        </div>
                        <div class="card">
                            <p:dataTable id="userMobileDataTable"
                                         style="width: 100%"
                                         var="userMobile"
                                         value="#{userMobileExportBean.lazyDataModel}"
                                         rows="#{constants:get('ROWS')}"
                                         lazy="true"
                                         paginator="true"
                                         paginatorTemplate="#{constants:get('PAGINATOR_TEMPLATE')}"
                                         rowsPerPageTemplate="#{constants:get('ROWS_PER_PAGE_TEMPLATE')}"
                                         emptyMessage="#{constants:get('EMPTY_MESSAGE')}"
                                         scrollable="true"
                                         scrollWidth="97%"
                                         reflow="true"
                                         resizableColumns="true">

                                <p:column headerText="推广页登记时间" >
                                     <h:outputText value="#{userMobile.recordTime}"/>
                                </p:column>
                                <p:column headerText="app注册时间">
                                    <h:outputText value="#{userMobile.registerTime}"/>
                                </p:column>
                                <p:column headerText="活动类型">
                                    <h:outputText value="#{userMobile.activityType}"/>
                                </p:column>
                                <p:column headerText="活动标识">
                                    <h:outputText value="#{userMobile.activityId}"/>
                                </p:column>
                                <p:column headerText="所属产品">
                                    <h:outputText value="#{userMobile.productId}"/>
                                </p:column>
                                <p:column headerText="所属渠道">
                                    <h:outputText value="#{userMobile.channelId}"/>
                                </p:column>
                                <p:column headerText="平台">
                                    <h:outputText value="#{userMobile.platform}"/>
                                </p:column>
                                <p:column headerText="用户类型">
                                    <h:outputText value="#{userMobile.userType=='0'? '注册用户' : '登记未注册用户'}"/>
                                </p:column>
                                  <p:column headerText="黑名单状态">
                                    <h:outputText value="#{userMobile.blacklist}"/>
                                </p:column>
                                  <p:column headerText="屏蔽联登活动">
                                    <h:outputText value="#{userMobileExportBean.translate(DictionaryCode.UNION_SERIAL,userMobile.unionLogin)}" />
                                </p:column>
                                <p:column headerText="手机号">
                                    <h:outputText value="#{userMobile.userId}"/>
                                </p:column>
                            </p:dataTable>
                        </div>
                    </div>
                </div>
            </div>
        </h:form>
    </ui:define>
</ui:composition>
